rm(list=ls())
load("../fits/main.RData")

### Generate list-level summary stats
print("List-level summary stats in table 5, in the appendix")
sumstat <- function (x)
  c(mean(x), sd(x), min(x), max(x))
sumstat(y.unscaled$emph.europe)
sumstat(y.unscaled$big3)
sumstat(y.unscaled$ingov)
sumstat(y.unscaled$propseats)
sumstat(y.unscaled$pro_anti_eu)

### Correlation matrix
cor(y.unscaled[,c("emph.europe", "big3", "ingov", "propseats", "pro_anti_eu")])

### VIF
vif <- function (fit) 1/(1-summary(fit)$r.squared)
vif(lm(emph.europe ~ big3 + ingov + propseats + pro_anti_eu, data=y.unscaled))
vif(lm(big3 ~ emph.europe + ingov + propseats + pro_anti_eu, data=y.unscaled))
vif(lm(ingov ~ big3 + emph.europe + propseats + pro_anti_eu, data=y.unscaled))
vif(lm(propseats ~ big3 + emph.europe + ingov + pro_anti_eu, data=y.unscaled))
vif(lm(pro_anti_eu ~ big3 + emph.europe + ingov + propseats, data=y.unscaled))